<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a href="{:U('Tui/Agent/resetPayPwd')}" target="_self">渠道支付密码管理</a></li>
        </ul>
        <form class="well form-search" method="get" action="{:U('Tui/Agent/resetPayPwd')}">
            <div class="search_type cc mb10">
                <div class="mb10">
                    <span class="mr20">
                        渠道名： 
                        <input type="text" name="agent" value="{$formget.agent}" placeholder="请输入渠道登录帐号" />
                       
                        &nbsp;&nbsp; 
                        <input type="submit" class="btn btn-primary" value="搜索" />
                    </span>
                </div>
            </div>
        </form>

        <form class="js-ajax-form" action="" method="post">
            <table class="table table-hover table-bordered table-list">
                <thead>
                    <tr>
                        <th width="20">ID</th>
                        <th width="50">登录名</th> 
                        <th width="50">类型</th> 
                        <th width="50">联系人</th>

                        <th width="50">操作</th>
                    </tr>
                </thead>

                <foreach name="items" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.user_login}</td>
                        <td>{$vo.user_type}</td>
                        <td>{$vo.user_nicename}</td>

                        <td>
                            <a href="#" class="edit_paypwd_btn" data-name="{$vo.user_login}" data-id="{$vo.id}">重设支付密码</a> 
                        </td>                          
                    </tr>
                </foreach>				
            </table>
            <div class="pagination">{$Page}</div>
        </form>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script>
        $(".edit_paypwd_btn").click(function(){
            var id=$(this).attr("data-id");
            var name=$(this).attr("data-name");
            var con=confirm("确定要重设用户【"+name+"】的支付密码吗？\r\n(默认支付密码为123456)");
            if (con){
                $.post("{:U('tui/agent/resetPayPwd_post')}",{"id":id},function(data){
                    if(data.error==='0'){
                        alert(data.msg);
                    }else{
                        alert(data.msg);
                    }
                });
            }
        });
    </script>
</body>
</html>